// author by welong
// zuowl@qq.com
// start : 2014-09-10  10:33
// end   : 2014-09-10  10:54
// PAT basic 1010

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
	int flag = 0, factor, exp;

	while(scanf("%d%d", &factor, &exp) != EOF && exp != 0)
	{
		if(!flag)
		{
			flag = 1;
			printf("%d %d", factor*exp, exp-1);
		}
		else
			printf(" %d %d", factor*exp, exp-1);
	}

	if(!flag)
		printf("0 0\n");
	else
		printf("\n");
	return 0;
}
/*
void derivation(int *factor, int *exp)
{
	(*factor) *= (*exp);
	(*exp)--;
}

int main(int argc, char **argv)
{
	int factor = -1, exp = -1;
	int i, count = 0, output[2000];

	while(scanf("%d%d", &factor, &exp) != EOF && exp != 0)
	{
		derivation(&factor, &exp);
		
		output[count++] = factor;
		output[count++] = exp;
	}

	for(i = 0; i < count; i++)
	{
		printf("%d", output[i]);
		if(i != count-1)
			printf(" ");
	}

	if(count == 0)
		printf("0 0\n");
	else
		printf("\n");

	return 0;
}
*/